import java.util.*;



public class Test17 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = new int[n + 1];
            int[] b = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                a[i] = in.nextInt();
            }
            for (int i = 1; i <= n; i++) {
                b[i] = in.nextInt();
            }

            int left = 1, right = 1;
            int suma = 0, sumb = 0;
            int purLeft = 0;
            for (; left <= n- k+1; left++) {
                if (left == 1) {
                    for (int i = left; i < left + k; i++) {
                        suma += a[i];
                        sumb += b[i];
                    }
                    purLeft = left;
                } else {
                    // 这里比快乐值
                    if (a[left - 1] >= a[left + k-1] ) {
                        // 快乐值相等时候，比羞耻值
                        if (a[left - 1] == a[left + k-1] && b[left - 1] > b[left + k-1]) {
                            suma = suma - a[left - 1] + a[left + k-1];
                            sumb = sumb - b[left - 1] + b[left + k-1];
                            purLeft = left;
                        }else if(a[left - 1] < a[left + k-1]){
                            suma = suma - a[left - 1] + a[left + k-1];
                            sumb = sumb - b[left - 1] + b[left + k-1];
                            purLeft = left;
                        }
                    } else {
                        suma = suma - a[left - 1] + a[left + k-1];
                        sumb = sumb - b[left - 1] + b[left + k-1];
                        purLeft=left;
                    }
                }

            }
            System.out.println(purLeft);
        }
    }




    public static void main02(String[] args) {
    }







    public static void main01(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) {
            int n = in.nextInt();
            int len = 0;
            Stack<Integer> stack = new Stack<>();
            while (n != 0) {
                if (n % 2 == 0) {
                    stack.add(0);
                } else {
                    stack.add(1);
                }
                len++;
                n /= 10;
            }
            int i=0;
            boolean b=false;
            while(i++<len){
                if(stack.peek()!= 0){
                    b=true;
                }
                if(!b){
                    stack.pop();
                }
                if(b){
                    System.out.print(stack.pop());
                }
                if(i == len && !b){
                    System.out.print(0);
                }
            }
        }
    }
}
